﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Shop.Model;
using Shop.Model.Custom;

namespace Shop.Framework.Page {
    public class CartItemsPage:ViewPage {

        public List<OrderItem> OrderItems { get; set; }

        protected override void OnLoad(EventArgs e) {
            OrderItems = WebCart.Self.OrderItem;
            if (OrderItems == null)
                OrderItems = WebCart.Self.OrderItem = new List<OrderItem>();

            foreach (var t in OrderItems) {
                TotalAmmount += t.Quantity * t.TaxedPrice;
            }
            base.OnLoad(e);
        }

        public decimal TotalAmmount { get; set; }

    }
}
